home *** CD-ROM | disk | FTP | other *** search
Unknown | 1997-03-29 | 4.2 KB |
view JSON data
|
view as text
|
open on a Mac
|
open on a PC
This file was not able to be converted.
This format is not currently supported by dexvert.
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| file
| data
| default
| |
100%
| gt2
| Kopftext: ';The following is an IRC Client example. It is very crude'
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 3b 54 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 20 69 |;The fol|lowing i|
|00000010| 73 20 61 6e 20 49 52 43 | 20 43 6c 69 65 6e 74 20 |s an IRC| Client |
|00000020| 65 78 61 6d 70 6c 65 2e | 20 49 74 20 69 73 20 76 |example.| It is v|
|00000030| 65 72 79 20 63 72 75 64 | 65 00 3b 61 6e 64 20 69 |ery crud|e.;and i|
|00000040| 74 20 69 73 20 6e 6f 74 | 20 69 6e 74 65 6e 64 65 |t is not| intende|
|00000050| 64 20 74 6f 20 62 65 20 | 61 20 66 75 6c 6c 20 70 |d to be |a full p|
|00000060| 72 6f 67 72 61 6d 2e 20 | 49 20 68 61 76 65 20 69 |rogram. |I have i|
|00000070| 6e 63 6c 75 64 65 64 00 | 3b 69 74 20 6f 6e 6c 79 |ncluded.|;it only|
|00000080| 20 74 6f 20 70 72 6f 76 | 69 64 65 20 61 20 67 75 | to prov|ide a gu|
|00000090| 69 64 65 20 6f 6e 20 75 | 73 69 6e 67 20 74 68 65 |ide on u|sing the|
|000000a0| 20 41 6d 69 54 43 50 20 | 65 78 74 20 6c 69 62 72 | AmiTCP |ext libr|
|000000b0| 61 72 79 2e 00 00 3b 20 | 43 72 65 61 74 65 20 49 |ary...; |Create I|
|000000c0| 6d 70 6f 72 74 61 6e 74 | 20 53 74 72 75 63 74 75 |mportant| Structu|
|000000d0| 72 65 73 20 75 73 65 64 | 20 62 79 20 41 6d 69 54 |res used| by AmiT|
|000000e0| 43 50 00 80 01 2e 6c 69 | 73 74 00 2a 49 74 65 6d |CP....li|st.*Item|
|000000f0| 41 2e 62 00 2a 49 74 65 | 6d 42 2e 62 00 80 02 20 |A.b.*Ite|mB.b... |
|00000100| 80 01 00 80 01 2e 69 6e | 61 64 64 72 00 73 5f 61 |......in|addr.s_a|
|00000110| 64 64 72 2e 6c 00 80 02 | 20 80 01 00 80 01 2e 73 |ddr.l...| ......s|
|00000120| 6f 63 6b 61 64 64 72 69 | 6e 00 73 69 6e 5f 6c 65 |ockaddri|n.sin_le|
|00000130| 6e 2e 62 00 73 69 6e 5f | 66 61 6d 69 6c 79 2e 62 |n.b.sin_|family.b|
|00000140| 00 73 69 6e 5f 70 6f 72 | 74 2e 77 00 73 69 6e 5f |.sin_por|t.w.sin_|
|00000150| 61 64 64 72 2e 69 6e 61 | 64 64 72 00 73 69 6e 5f |addr.ina|ddr.sin_|
|00000160| 7a 65 72 6f 2e 62 5b 38 | 5d 00 80 02 20 80 01 00 |zero.b[8|]... ...|
|00000170| 80 01 2e 68 6f 73 74 65 | 6e 74 00 2a 68 5f 6e 61 |...hoste|nt.*h_na|
|00000180| 6d 65 2e 62 00 2a 68 5f | 61 6c 69 61 73 65 73 2e |me.b.*h_|aliases.|
|00000190| 6c 69 73 74 00 68 5f 61 | 64 64 72 74 79 70 65 2e |list.h_a|ddrtype.|
|000001a0| 6c 00 68 5f 6c 65 6e 67 | 68 74 2e 6c 00 2a 68 5f |l.h_leng|ht.l.*h_|
|000001b0| 61 64 64 72 5f 6c 69 73 | 74 2e 6c 69 73 74 00 80 |addr_lis|t.list..|
|000001c0| 02 20 80 01 00 00 3b 55 | 73 65 20 57 42 20 73 63 |. ....;U|se WB sc|
|000001d0| 72 65 65 6e 00 cf 02 20 | 31 00 00 3b 49 6e 70 75 |reen... |1..;Inpu|
|000001e0| 74 20 55 73 65 72 20 64 | 65 74 61 69 6c 73 00 dd |t User d|etails..|
|000001f0| 81 22 45 6e 74 65 72 20 | 73 65 72 76 65 72 27 73 |."Enter |server's|
|00000200| 20 6e 61 6d 65 3f 22 00 | 61 24 3d dd 01 28 34 30 | name?".|a$=..(40|
|00000210| 29 00 dd 81 22 45 6e 74 | 65 72 20 4e 69 63 6b 6e |)..."Ent|er Nickn|
|00000220| 61 6d 65 3f 22 00 6e 24 | 3d dd 01 28 37 29 00 dd |ame?".n$|=..(7)..|
|00000230| 81 22 45 6e 74 65 72 20 | 52 65 61 6c 6e 61 6d 65 |."Enter |Realname|
|00000240| 3f 22 00 72 6e 24 3d dd | 01 28 31 36 29 00 00 3b |?".rn$=.|.(16)..;|
|00000250| 46 6f 72 20 74 68 65 20 | 48 6f 73 74 6e 61 6d 65 |For the |Hostname|
|00000260| 20 76 61 72 69 61 62 6c | 65 20 77 65 20 63 61 6e | variabl|e we can|
|00000270| 20 72 65 61 64 20 69 74 | 20 66 72 6f 6d 20 74 68 | read it| from th|
|00000280| 65 20 73 65 72 76 65 72 | 00 68 24 3d dc 88 28 dc |e server|.h$=..(.|
|00000290| 86 28 30 29 2c 33 30 29 | 20 20 20 20 20 20 20 20 |.(0),30)| |
|000002a0| 3b 4d 61 6b 65 20 68 24 | 20 61 20 33 30 20 63 68 |;Make h$| a 30 ch|
|000002b0| 61 72 61 63 68 74 65 72 | 73 20 6c 6f 6e 67 20 73 |arachter|s long s|
|000002c0| 74 72 69 6e 67 20 66 69 | 6c 6c 65 64 20 77 69 74 |tring fi|lled wit|
|000002d0| 68 20 4e 55 4c 4c 00 61 | 3d ec ab 28 26 68 24 2c |h NULL.a|=..(&h$,|
|000002e0| 33 30 29 20 20 20 20 20 | 20 20 20 3b 47 65 74 68 |30) | ;Geth|
|000002f0| 6f 73 74 6e 61 6d 65 20 | 61 6e 64 20 70 6c 61 63 |ostname |and plac|
|00000300| 65 20 69 74 20 69 6e 20 | 68 24 00 00 3b 43 72 65 |e it in |h$..;Cre|
|00000310| 61 74 65 20 61 20 74 65 | 78 74 20 67 61 64 67 65 |ate a te|xt gadge|
|00000320| 74 20 66 6f 72 20 74 65 | 78 74 20 69 6e 70 75 74 |t for te|xt input|
|00000330| 20 61 6e 64 20 70 6c 61 | 63 65 20 69 74 20 69 6e | and pla|ce it in|
|00000340| 20 61 20 77 69 6e 64 6f | 77 00 c6 02 20 31 2c 36 | a windo|w... 1,6|
|00000350| 35 2c 37 2c 30 2c 31 2c | 31 30 30 2c 35 30 30 00 |5,7,0,1,|100,500.|
|00000360| c5 01 20 31 2c 32 30 2c | 32 30 30 2c 36 30 30 2c |.. 1,20,|200,600,|
|00000370| 34 30 2c 24 34 31 37 2c | 22 45 6e 74 65 72 20 61 |40,$417,|"Enter a|
|00000380| 20 63 6f 6d 6d 61 6e 64 | 2e 2e 2e 22 2c 30 2c 31 | command|...",0,1|
|00000390| 2c 31 00 c5 10 20 39 2c | 39 3a dd 81 20 6e 24 00 |,1... 9,|9:.. n$.|
|000003a0| 00 3b 4f 70 65 6e 20 61 | 20 77 69 6e 64 6f 77 20 |.;Open a| window |
|000003b0| 66 6f 72 20 74 65 78 74 | 20 6f 75 74 70 75 74 00 |for text| output.|
|000003c0| c5 01 20 32 2c 32 30 2c | 31 30 2c 36 30 30 2c 31 |.. 2,20,|10,600,1|
|000003d0| 38 39 2c 24 34 31 37 2c | 22 49 72 63 20 43 6c 69 |89,$417,|"Irc Cli|
|000003e0| 65 6e 74 20 4f 75 74 70 | 75 74 22 2c 30 2c 31 00 |ent Outp|ut",0,1.|
|000003f0| 00 3b 43 72 65 61 74 65 | 20 61 20 73 74 72 65 61 |.;Create| a strea|
|00000400| 6d 20 73 6f 63 6b 65 74 | 00 73 6f 63 6b 2e 6c 3d |m socket|.sock.l=|
|00000410| ec 81 28 32 2c 31 2c 30 | 29 00 00 3b 47 65 74 20 |..(2,1,0|)..;Get |
|00000420| 44 65 74 61 69 6c 73 20 | 6f 66 20 49 52 43 20 73 |Details |of IRC s|
|00000430| 65 72 76 65 72 20 61 6e | 64 20 70 6c 61 63 65 20 |erver an|d place |
|00000440| 74 68 65 6d 20 69 6e 20 | 61 2e 68 6f 73 74 65 6e |them in |a.hosten|
|00000450| 74 20 73 74 72 75 63 74 | 75 72 65 00 2a 61 2e 68 |t struct|ure.*a.h|
|00000460| 6f 73 74 65 6e 74 3d ec | 9f 28 61 24 29 00 00 3b |ostent=.|.(a$)..;|
|00000470| 43 6f 70 79 20 74 68 65 | 20 68 6f 73 74 20 61 64 |Copy the| host ad|
|00000480| 64 72 65 73 73 20 69 6e | 20 6f 75 72 20 73 6f 63 |dress in| our soc|
|00000490| 6b 61 64 64 72 69 6e 20 | 73 74 72 75 63 74 75 72 |kaddrin |structur|
|000004a0| 65 00 62 62 3d fe db 28 | 2a 61 2e 68 6f 73 74 65 |e.bb=..(|*a.hoste|
|000004b0| 6e 74 5c 68 5f 61 64 64 | 72 5f 6c 69 73 74 5c 49 |nt\h_add|r_list\I|
|000004c0| 74 65 6d 41 2c 26 68 6f | 73 74 2e 73 6f 63 6b 61 |temA,&ho|st.socka|
|000004d0| 64 64 72 69 6e 5c 73 69 | 6e 5f 61 64 64 72 2c 2a |ddrin\si|n_addr,*|
|000004e0| 61 2e 68 6f 73 74 65 6e | 74 5c 68 5f 6c 65 6e 67 |a.hosten|t\h_leng|
|000004f0| 68 74 29 00 00 68 6f 73 | 74 2e 73 6f 63 6b 61 64 |ht)..hos|t.sockad|
|00000500| 64 72 69 6e 5c 73 69 6e | 5f 70 6f 72 74 3d 36 36 |drin\sin|_port=66|
|00000510| 36 37 20 20 20 20 20 3b | 53 65 74 20 70 6f 72 74 |67 ;|Set port|
|00000520| 20 74 6f 20 75 73 75 61 | 6c 20 36 36 36 37 00 68 | to usua|l 6667.h|
|00000530| 6f 73 74 2e 73 6f 63 6b | 61 64 64 72 69 6e 5c 73 |ost.sock|addrin\s|
|00000540| 69 6e 5f 66 61 6d 69 6c | 79 3d 32 20 20 20 20 20 |in_famil|y=2 |
|00000550| 20 3b 53 65 74 20 54 79 | 70 65 20 74 6f 20 41 46 | ;Set Ty|pe to AF|
|00000560| 5f 49 4e 45 54 00 6c 65 | 6e 67 68 74 3d 80 2f 2e |_INET.le|nght=./.|
|00000570| 73 6f 63 6b 61 64 64 72 | 69 6e 20 20 20 20 20 20 |sockaddr|in |
|00000580| 20 20 20 20 3b 47 65 74 | 20 6c 65 6e 67 68 74 20 | ;Get| lenght |
|00000590| 6f 66 20 53 6f 63 6b 61 | 64 64 72 69 6e 20 73 74 |of Socka|ddrin st|
|000005a0| 72 75 63 74 75 72 65 00 | 00 3b 43 6f 6e 6e 65 63 |ructure.|.;Connec|
|000005b0| 74 20 74 6f 20 74 68 65 | 20 49 52 43 20 53 65 72 |t to the| IRC Ser|
|000005c0| 76 65 72 00 62 3d ec 85 | 28 73 6f 63 6b 2e 6c 2c |ver.b=..|(sock.l,|
|000005d0| 68 6f 73 74 2e 73 6f 63 | 6b 61 64 64 72 69 6e 2c |host.soc|kaddrin,|
|000005e0| 6c 65 6e 67 68 74 29 00 | 80 0b 20 62 3d 30 20 80 |lenght).|.. b=0 .|
|000005f0| 21 20 dd 82 20 22 43 6f | 6e 6e 65 63 74 65 64 20 |! .. "Co|nnected |
|00000600| 74 6f 20 73 65 72 76 65 | 72 20 22 2c 61 24 20 20 |to serve|r ",a$ |
|00000610| 20 20 3b 43 6f 6e 6e 65 | 63 74 69 6f 6e 20 53 75 | ;Conne|ction Su|
|00000620| 63 63 65 73 73 66 75 6c | 6c 00 80 0b 20 62 3d 2d |ccessful|l... b=-|
|00000630| 31 20 80 21 20 dd 82 20 | 22 55 6e 61 62 6c 65 20 |1 .! .. |"Unable |
|00000640| 74 6f 20 63 6f 6e 6e 65 | 63 74 20 74 6f 20 73 65 |to conne|ct to se|
|00000650| 72 76 65 72 20 22 2c 61 | 24 3a 80 05 20 66 69 6e |rver ",a|$:.. fin|
|00000660| 69 73 68 20 20 20 3b 49 | 66 20 77 65 20 66 61 69 |ish ;I|f we fai|
|00000670| 6c 20 74 6f 20 63 6f 6e | 6e 65 63 74 20 65 78 69 |l to con|nect exi|
|00000680| 74 00 00 6d 65 6d 2e 6c | 3d fe 97 28 24 32 30 30 |t..mem.l|=..($200|
|00000690| 30 2c 31 29 20 20 20 20 | 20 20 20 20 3b 43 72 65 |0,1) | ;Cre|
|000006a0| 61 74 65 20 61 20 62 75 | 66 66 65 72 20 66 6f 72 |ate a bu|ffer for|
|000006b0| 20 69 6e 63 6f 6d 69 6e | 67 20 64 61 74 61 00 00 | incomin|g data..|
|000006c0| 3b 53 65 6e 64 20 4e 69 | 63 6b 00 64 24 3d 22 6e |;Send Ni|ck.d$="n|
|000006d0| 69 63 6b 20 22 2b 6e 24 | 3a dd 82 20 22 53 65 6e |ick "+n$|:.. "Sen|
|000006e0| 64 69 6e 67 20 4e 69 63 | 6b 22 00 80 06 20 77 72 |ding Nic|k"... wr|
|000006f0| 69 74 65 72 00 00 3b 53 | 65 6e 64 20 55 73 65 72 |iter..;S|end User|
|00000700| 20 64 65 74 61 69 6c 73 | 00 64 24 3d 22 75 73 65 | details|.d$="use|
|00000710| 72 20 22 2b 6e 24 2b 22 | 20 22 2b 68 24 2b 22 20 |r "+n$+"| "+h$+" |
|00000720| 2d 20 3a 22 2b 72 6e 24 | 00 dd 82 20 22 53 65 6e |- :"+rn$|... "Sen|
|00000730| 64 69 6e 67 20 55 73 65 | 72 6e 61 6d 65 22 00 80 |ding Use|rname"..|
|00000740| 06 20 77 72 69 74 65 72 | 00 00 3b 4e 6f 77 20 77 |. writer|..;Now w|
|00000750| 61 69 74 20 66 6f 72 20 | 72 65 73 70 6f 6e 73 65 |ait for |response|
|00000760| 20 66 72 6f 6d 20 73 65 | 72 76 65 72 00 dd 82 20 | from se|rver... |
|00000770| 22 52 65 71 75 65 73 74 | 20 73 65 6e 74 2c 20 77 |"Request| sent, w|
|00000780| 61 69 74 69 6e 67 20 66 | 6f 72 20 72 65 73 70 6f |aiting f|or respo|
|00000790| 6e 73 65 2e 2e 2e 22 00 | 80 06 20 72 65 73 70 6f |nse...".|.. respo|
|000007a0| 6e 73 65 20 20 20 20 20 | 20 20 20 3b 47 65 74 20 |nse | ;Get |
|000007b0| 53 65 72 76 65 72 73 20 | 72 65 73 70 6f 6e 73 65 |Servers |response|
|000007c0| 00 00 3b 50 72 69 6e 74 | 20 73 65 72 76 65 72 73 |..;Print| servers|
|000007d0| 20 72 65 73 70 6f 6e 73 | 65 20 61 6e 64 20 6d 61 | respons|e and ma|
|000007e0| 6b 65 20 49 6e 70 75 74 | 20 53 74 72 69 6e 67 20 |ke Input| String |
|000007f0| 47 61 64 67 65 74 20 26 | 20 57 69 6e 64 6f 77 20 |Gadget &| Window |
|00000800| 61 63 74 69 76 65 2e 00 | dd 82 20 63 24 3a c5 1f |active..|.. c$:..|
|00000810| 20 31 00 c6 12 20 31 2c | 31 3a c6 0b 20 31 2c 31 | 1... 1,|1:.. 1,1|
|00000820| 00 2e 72 65 70 65 61 74 | 65 72 00 00 3b 57 68 69 |..repeat|er..;Whi|
|00000830| 6c 65 20 74 68 65 20 75 | 73 65 72 20 69 73 20 74 |le the u|ser is t|
|00000840| 79 70 69 6e 67 20 61 20 | 6d 65 73 73 61 67 65 2c |yping a |message,|
|00000850| 20 74 68 65 20 73 74 72 | 69 6e 67 20 67 61 64 67 | the str|ing gadg|
|00000860| 65 74 20 77 69 6c 6c 20 | 62 65 20 61 63 74 69 76 |et will |be activ|
|00000870| 65 00 3b 62 75 74 20 77 | 68 65 6e 20 74 68 65 20 |e.;but w|hen the |
|00000880| 75 73 65 72 20 70 72 65 | 73 73 65 73 20 72 65 74 |user pre|sses ret|
|00000890| 75 72 6e 20 6b 65 79 20 | 69 74 20 77 69 6c 6c 20 |urn key |it will |
|000008a0| 62 65 20 69 6e 61 63 74 | 69 76 65 2e 20 54 68 65 |be inact|ive. The|
|000008b0| 20 66 6f 6c 6c 6f 77 69 | 6e 67 00 3b 70 61 72 74 | followi|ng.;part|
|000008c0| 20 6f 66 20 74 68 65 20 | 70 72 6f 67 72 61 6d 20 | of the |program |
|000008d0| 63 68 65 63 6b 73 20 74 | 6f 20 73 65 65 20 69 66 |checks t|o see if|
|000008e0| 20 74 68 65 20 73 74 72 | 69 6e 67 20 67 61 64 67 | the str|ing gadg|
|000008f0| 65 74 20 69 73 20 69 6e | 61 63 74 69 76 65 20 61 |et is in|active a|
|00000900| 6e 64 00 3b 69 6e 20 74 | 68 61 74 20 63 61 73 65 |nd.;in t|hat case|
|00000910| 20 73 65 6e 64 20 74 68 | 65 20 74 79 70 65 64 20 | send th|e typed |
|00000920| 6d 65 73 73 61 67 65 20 | 74 6f 20 74 68 65 20 49 |message |to the I|
|00000930| 52 43 20 73 65 72 76 65 | 72 2e 00 00 c5 1f 20 31 |RC serve|r..... 1|
|00000940| 20 20 20 20 20 20 3b 4d | 61 6b 65 20 57 69 6e 64 | ;M|ake Wind|
|00000950| 6f 77 20 61 63 74 69 76 | 65 00 80 0b 20 c6 1d 28 |ow activ|e... ..(|
|00000960| 31 2c 31 29 3d bc 0e 20 | 80 21 20 80 05 20 68 65 |1,1)=.. |.! .. he|
|00000970| 72 65 20 20 20 20 20 3b | 43 68 65 63 6b 20 69 66 |re ;|Check if|
|00000980| 20 47 61 64 67 65 74 20 | 69 73 20 61 63 74 69 76 | Gadget |is activ|
|00000990| 65 20 69 66 20 79 65 73 | 20 73 6b 69 70 20 6e 65 |e if yes| skip ne|
|000009a0| 78 74 20 70 61 72 74 00 | 64 24 3d c6 14 28 31 2c |xt part.|d$=..(1,|
|000009b0| 31 29 3a 80 0b 20 64 24 | 3d 22 65 78 69 74 22 20 |1):.. d$|="exit" |
|000009c0| 80 21 20 80 05 20 66 69 | 6e 69 73 68 20 20 20 20 |.! .. fi|nish |
|000009d0| 3b 49 66 20 75 73 65 72 | 20 74 79 70 65 73 20 65 |;If user| types e|
|000009e0| 78 69 74 20 71 75 69 74 | 20 70 72 6f 67 72 61 6d |xit quit| program|
|000009f0| 00 80 06 20 77 72 69 74 | 65 72 20 20 20 20 3b 73 |... writ|er ;s|
|00000a00| 65 6e 64 20 74 79 70 65 | 64 20 6d 65 73 73 61 67 |end type|d messag|
|00000a10| 65 00 00 3b 4d 61 6b 65 | 20 74 68 65 20 53 74 72 |e..;Make| the Str|
|00000a20| 69 6e 67 20 47 61 64 67 | 65 74 20 26 20 57 69 6e |ing Gadg|et & Win|
|00000a30| 64 6f 77 20 61 63 74 69 | 76 65 20 61 67 61 69 6e |dow acti|ve again|
|00000a40| 00 c6 1b 20 31 2c 31 2c | 22 22 3a c5 1f 20 31 00 |... 1,1,|"":.. 1.|
|00000a50| c6 12 20 31 2c 31 00 c6 | 0b 20 31 2c 31 00 2e 68 |.. 1,1..|. 1,1..h|
|00000a60| 65 72 65 00 80 06 20 72 | 65 61 64 65 72 20 20 20 |ere... r|eader |
|00000a70| 20 20 3b 52 65 61 64 20 | 61 6e 79 20 69 6e 63 6f | ;Read |any inco|
|00000a80| 6d 69 6e 67 20 64 61 74 | 61 00 80 0b 20 66 66 3e |ming dat|a... ff>|
|00000a90| 30 20 80 21 20 dd 81 20 | 63 24 20 20 20 20 3b 50 |0 .! .. |c$ ;P|
|00000aa0| 72 69 6e 74 20 61 6e 79 | 20 64 61 74 61 20 6c 65 |rint any| data le|
|00000ab0| 66 74 00 80 05 20 72 65 | 70 65 61 74 65 72 00 00 |ft... re|peater..|
|00000ac0| 3b 43 6c 6f 73 65 20 77 | 69 6e 64 6f 77 73 2c 20 |;Close w|indows, |
|00000ad0| 66 72 65 65 20 62 75 66 | 66 65 72 20 6d 65 6d 6f |free buf|fer memo|
|00000ae0| 72 79 2c 20 63 6c 6f 73 | 65 20 63 6f 6e 6e 65 63 |ry, clos|e connec|
|00000af0| 74 69 6f 6e 20 61 6e 64 | 20 71 75 69 74 00 2e 66 |tion and| quit..f|
|00000b00| 69 6e 69 73 68 00 80 2b | 20 c5 01 20 31 00 80 2b |inish..+| .. 1..+|
|00000b10| 20 c5 01 20 32 00 64 3d | fe 99 28 6d 65 6d 2e 6c | .. 2.d=|..(mem.l|
|00000b20| 2c 24 31 30 30 30 29 00 | ec 90 28 73 6f 63 6b 2e |,$1000).|..(sock.|
|00000b30| 6c 29 00 80 02 00 00 3b | 54 68 69 73 20 70 61 72 |l).....;|This par|
|00000b40| 74 20 69 73 20 74 68 65 | 20 70 61 72 74 20 77 68 |t is the| part wh|
|00000b50| 69 63 68 20 77 61 69 74 | 73 20 66 6f 72 20 72 65 |ich wait|s for re|
|00000b60| 73 70 6f 6e 73 65 20 66 | 72 6f 6d 20 73 65 72 76 |sponse f|rom serv|
|00000b70| 65 72 00 2e 72 65 73 70 | 6f 6e 73 65 00 73 6f 63 |er..resp|onse.soc|
|00000b80| 6b 72 65 61 64 2e 6c 3d | 30 20 20 20 20 20 20 20 |kread.l=|0 |
|00000b90| 20 20 20 20 20 20 20 20 | 20 20 3b 43 6c 65 61 72 | | ;Clear|
|00000ba0| 20 52 65 61 64 6d 61 73 | 6b 00 73 6f 63 6b 72 65 | Readmas|k.sockre|
|00000bb0| 61 64 2e 6c 20 80 ce 20 | 73 6f 63 6b 2e 6c 20 20 |ad.l .. |sock.l |
|00000bc0| 20 20 20 3b 53 65 74 20 | 52 65 61 64 6d 61 73 6b | ;Set |Readmask|
|00000bd0| 20 66 6f 72 20 6f 75 72 | 20 73 6f 63 6b 65 74 00 | for our| socket.|
|00000be0| 67 3d ec 91 28 32 2c 26 | 73 6f 63 6b 72 65 61 64 |g=..(2,&|sockread|
|00000bf0| 2e 6c 2c 30 2c 30 2c 30 | 2c 30 29 20 20 20 3b 57 |.l,0,0,0|,0) ;W|
|00000c00| 61 69 74 20 75 6e 74 69 | 6c 20 77 65 20 67 65 74 |ait unti|l we get|
|00000c10| 20 61 20 72 65 73 70 6f | 6e 73 65 00 00 3b 54 68 | a respo|nse..;Th|
|00000c20| 69 73 20 70 61 72 74 20 | 72 65 61 64 73 20 64 61 |is part |reads da|
|00000c30| 74 61 20 66 72 6f 6d 20 | 73 65 72 76 65 72 00 2e |ta from |server..|
|00000c40| 72 65 61 64 65 72 00 00 | 3b 53 65 65 20 68 6f 77 |reader..|;See how|
|00000c50| 20 6d 75 63 68 20 64 61 | 74 61 20 69 73 20 77 61 | much da|ta is wa|
|00000c60| 69 74 69 6e 67 20 74 6f | 20 62 65 20 72 65 61 64 |iting to| be read|
|00000c70| 00 61 72 2e 6c 3d 24 34 | 30 30 34 36 36 37 66 20 |.ar.l=$4|004667f |
|00000c80| 20 20 20 3b 46 49 4f 4e | 52 45 41 44 20 76 61 6c | ;FION|READ val|
|00000c90| 75 65 00 65 3d ec 8f 28 | 73 6f 63 6b 2e 6c 2c 61 |ue.e=..(|sock.l,a|
|00000ca0| 72 2e 6c 2c 6d 65 6d 2e | 6c 29 20 20 20 3b 43 68 |r.l,mem.|l) ;Ch|
|00000cb0| 65 63 6b 20 68 6f 77 20 | 6d 75 63 68 20 64 61 74 |eck how |much dat|
|00000cc0| 61 20 69 73 20 77 61 69 | 74 69 6e 67 20 74 6f 20 |a is wai|ting to |
|00000cd0| 62 65 20 72 65 61 64 00 | 66 3d da 02 2e 6c 28 6d |be read.|f=...l(m|
|00000ce0| 65 6d 2e 6c 29 3a 66 66 | 3d 66 20 20 20 20 20 20 |em.l):ff|=f |
|00000cf0| 20 20 20 20 20 20 20 20 | 20 20 3b 61 6e 64 20 70 | | ;and p|
|00000d00| 6c 61 63 65 20 69 74 20 | 69 6e 20 66 20 61 6e 64 |lace it |in f and|
|00000d10| 20 66 66 20 76 61 72 69 | 61 62 6c 65 73 00 00 63 | ff vari|ables..c|
|00000d20| 3d ec 89 28 73 6f 63 6b | 2e 6c 2c 6d 65 6d 2e 6c |=..(sock|.l,mem.l|
|00000d30| 2c 66 2c 30 29 20 20 20 | 20 20 20 20 20 20 20 20 |,f,0) | |
|00000d40| 3b 52 65 61 64 20 66 20 | 64 61 74 61 20 66 72 6f |;Read f |data fro|
|00000d50| 6d 20 73 65 72 76 65 72 | 20 61 6e 64 20 70 6c 61 |m server| and pla|
|00000d60| 63 65 20 69 74 20 69 6e | 20 62 75 66 66 65 72 00 |ce it in| buffer.|
|00000d70| 00 3b 54 68 69 73 20 72 | 6f 75 74 69 6e 65 20 72 |.;This r|outine r|
|00000d80| 65 61 64 73 20 64 61 74 | 61 20 66 72 6f 6d 20 74 |eads dat|a from t|
|00000d90| 68 65 20 62 75 66 66 65 | 72 20 61 6e 64 20 70 6c |he buffe|r and pl|
|00000da0| 61 63 65 73 20 69 74 20 | 69 6e 20 63 24 00 62 75 |aces it |in c$.bu|
|00000db0| 66 2e 6c 3d 6d 65 6d 2e | 6c 00 78 3d da 02 2e 62 |f.l=mem.|l.x=...b|
|00000dc0| 28 62 75 66 2e 6c 29 3a | 63 24 3d 22 22 00 80 0c |(buf.l):|c$=""...|
|00000dd0| 20 66 3e 30 00 63 24 3d | 63 24 2b dc 86 28 78 29 | f>0.c$=|c$+..(x)|
|00000de0| 00 80 0b 20 dc 86 28 78 | 29 3d dc 86 28 31 33 29 |... ..(x|)=..(13)|
|00000df0| 20 80 21 20 80 06 20 68 | 65 72 65 32 20 20 20 3b | .! .. h|ere2 ;|
|00000e00| 49 66 20 69 74 73 20 61 | 20 43 52 20 74 68 65 6e |If its a| CR then|
|00000e10| 20 67 6f 20 74 6f 20 70 | 72 69 6e 74 20 6c 69 6e | go to p|rint lin|
|00000e20| 65 00 62 75 66 2e 6c 3d | 62 75 66 2e 6c 2b 31 00 |e.buf.l=|buf.l+1.|
|00000e30| 78 3d da 02 2e 62 28 62 | 75 66 2e 6c 29 00 66 3d |x=...b(b|uf.l).f=|
|00000e40| 66 2d 31 00 80 c1 00 80 | 07 00 00 3b 54 68 69 73 |f-1.....|...;This|
|00000e50| 20 72 6f 75 74 69 6e 65 | 20 70 72 69 6e 74 73 20 | routine| prints |
|00000e60| 6c 69 6e 65 00 2e 68 65 | 72 65 32 00 63 7a 3d 30 |line..he|re2.cz=0|
|00000e70| 3a 63 7a 24 3d 22 22 00 | 00 3b 54 68 69 73 20 72 |:cz$="".|.;This r|
|00000e80| 6f 75 74 69 6e 65 20 73 | 74 72 69 70 73 20 61 6e |outine s|trips an|
|00000e90| 79 20 6c 65 61 64 69 6e | 67 20 63 68 61 72 61 63 |y leadin|g charac|
|00000ea0| 68 74 65 72 73 20 66 72 | 6f 6d 20 6c 69 6e 65 00 |hters fr|om line.|
|00000eb0| 80 16 20 7a 3d 31 20 80 | 18 20 dc 8f 28 63 24 29 |.. z=1 .|. ..(c$)|
|00000ec0| 2d 31 00 63 63 24 3d dc | 83 28 63 24 2c 7a 2c 31 |-1.cc$=.|.(c$,z,1|
|00000ed0| 29 00 80 0b 20 63 63 24 | 3d 22 3a 22 20 80 21 20 |)... cc$|=":" .! |
|00000ee0| 63 7a 3d 63 7a 2b 31 20 | 20 20 20 20 20 3b 53 74 |cz=cz+1 | ;St|
|00000ef0| 72 69 70 20 61 6e 79 20 | 6c 65 61 64 69 6e 67 20 |rip any |leading |
|00000f00| 63 68 61 72 61 63 68 74 | 65 72 73 00 80 0b 20 63 |characht|ers... c|
|00000f10| 7a 3e 31 20 80 21 20 63 | 7a 24 3d 63 7a 24 2b 63 |z>1 .! c|z$=cz$+c|
|00000f20| 63 24 00 80 17 20 7a 00 | dd 82 20 63 7a 24 20 20 |c$... z.|.. cz$ |
|00000f30| 20 20 20 20 20 3b 50 72 | 69 6e 74 20 4c 69 6e 65 | ;Pr|int Line|
|00000f40| 00 63 24 3d 22 22 00 62 | 75 66 2e 6c 3d 62 75 66 |.c$="".b|uf.l=buf|
|00000f50| 2e 6c 2b 31 3a c5 3d 20 | 20 20 20 20 3b 53 63 72 |.l+1:.= | ;Scr|
|00000f60| 6f 6c 6c 20 73 63 72 65 | 65 6e 20 69 66 20 77 65 |oll scre|en if we|
|00000f70| 20 61 72 65 20 61 74 20 | 62 6f 74 74 6f 6d 20 6f | are at |bottom o|
|00000f80| 66 20 73 63 72 65 65 6e | 00 80 07 00 00 3b 54 68 |f screen|.....;Th|
|00000f90| 69 73 20 72 6f 75 74 69 | 6e 65 20 73 65 6e 64 20 |is routi|ne send |
|00000fa0| 64 61 74 61 20 74 6f 20 | 73 65 72 76 65 72 00 2e |data to |server..|
|00000fb0| 77 72 69 74 65 72 00 73 | 6f 63 6b 77 72 69 74 65 |writer.s|ockwrite|
|00000fc0| 2e 6c 3d 30 20 20 20 20 | 20 20 20 20 20 20 20 20 |.l=0 | |
|00000fd0| 20 20 20 20 20 20 20 20 | 3b 43 6c 65 61 72 20 57 | |;Clear W|
|00000fe0| 72 69 74 65 4d 61 73 6b | 00 73 6f 63 6b 77 72 69 |riteMask|.sockwri|
|00000ff0| 74 65 2e 6c 20 80 ce 20 | 73 6f 63 6b 2e 6c 20 20 |te.l .. |sock.l |
|00001000| 20 20 20 20 20 20 3b 53 | 65 74 20 57 72 69 74 65 | ;S|et Write|
|00001010| 4d 61 73 6b 20 66 6f 72 | 20 6f 75 72 20 73 6f 63 |Mask for| our soc|
|00001020| 6b 65 74 00 67 3d ec 91 | 28 32 2c 30 2c 26 73 6f |ket.g=..|(2,0,&so|
|00001030| 63 6b 77 72 69 74 65 2e | 6c 2c 30 2c 30 2c 30 29 |ckwrite.|l,0,0,0)|
|00001040| 20 20 20 20 20 3b 57 61 | 69 74 20 75 6e 74 69 6c | ;Wa|it until|
|00001050| 20 73 65 72 76 65 72 20 | 69 73 20 72 65 61 64 79 | server |is ready|
|00001060| 20 66 6f 72 20 6f 75 72 | 20 64 61 74 61 00 64 24 | for our| data.d$|
|00001070| 3d 64 24 2b dc 86 28 24 | 61 29 3a 6c 3d dc 8f 28 |=d$+..($|a):l=..(|
|00001080| 64 24 29 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |d$) | |
|00001090| 20 20 20 20 20 3b 41 64 | 64 20 61 20 6c 69 6e 65 | ;Ad|d a line|
|000010a0| 20 66 65 65 64 20 74 6f | 20 6f 75 72 20 73 74 72 | feed to| our str|
|000010b0| 69 6e 67 00 63 3d ec 87 | 28 73 6f 63 6b 2e 6c 2c |ing.c=..|(sock.l,|
|000010c0| 64 24 2c 6c 2c 30 29 20 | 20 20 20 20 20 20 20 20 |d$,l,0) | |
|000010d0| 20 20 20 20 20 20 20 20 | 20 20 20 3b 53 65 6e 64 | | ;Send|
|000010e0| 20 64 61 74 61 20 74 6f | 20 73 65 72 76 65 72 00 | data to| server.|
|000010f0| 80 07 00 | |... | |
+--------+-------------------------+-------------------------+--------+--------+